package com.itheima.reggie.common;

public class BaseContext {
    private final static ThreadLocal<Long>THREAD_LOCAL_USER_ID=new ThreadLocal<>();
    public static ThreadLocal<Long> instance(){
        return THREAD_LOCAL_USER_ID;

    }

    public static void setCurrentId(Long userId) {
        THREAD_LOCAL_USER_ID.set(userId);
    }
    public static Long getCurrentId(){
        return THREAD_LOCAL_USER_ID.get();
    }
}
